package com.rainy.generator.service.impl;

import com.rainy.generator.dao.TableDao;
import com.rainy.generator.entity.ColumnEntity;
import com.rainy.generator.entity.TableEntity;
import com.rainy.generator.entity.TableQuery;
import com.rainy.generator.service.TableService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author liuqin on 2017/12/16
 */
@Service("tableService")
public class TableServiceImpl implements TableService{
    @Resource
    private TableDao tableDao;

    @Override
    public TableEntity queryTable(String db,String tableName) {
        return tableDao.queryTable(db,tableName);
    }

    @Override
    public List<TableEntity> queryTables(TableQuery tableQuery) {
        return tableDao.queryTables(tableQuery);
    }

    @Override
    public Long queryCount(TableQuery tableQuery) {
        return tableDao.queryCount(tableQuery);
    }

    @Override
    public List<Map<String,String>> queryColumns(String db,String tableName) {
        return tableDao.queryColumns(db,tableName);
    }

    @Override
    public String getConnectDb() {
        return tableDao.getConnectDb();
    }

    @Override
    public List<String> queryDataBases() {
        return tableDao.queryDataBases();
    }
}
